package com.songlanyun.common.utils;

import com.songlanyun.common.enums.VerifyCodeConstant;

import cn.hutool.core.util.ObjectUtil;

/**
 * 短信验证码模板
 *
 * @author lijiahe 2022-09-23
 */
public class SendTemplate {
    private static final String REGISTER_TEMPLATE = "您的手机验证码为%1，5分钟内有效。请不要把此验证码泄露给任何人。【绿马公益】";
    private static final String VERIFIED_TEMPLATE = "您的手机验证码为%1，5分钟内有效。请不要把此验证码泄露给任何人。【绿马公益】";
    private static final String SET_PASSWORD_TEMPLATE = "您的手机验证码为%1，5分钟内有效。请不要把此验证码泄露给任何人。【绿马公益】";

    /**
     * 获取登录的短信模板
     *
     * @param verifyCodeType
     * @return
     */
    public static String getTemplateStr(Integer verifyCodeType) {
        VerifyCodeConstant.VerifyCode verifyCode = VerifyCodeConstant.VerifyCode.getByCode(verifyCodeType);
        String template = "";
        if (ObjectUtil.isNotNull(verifyCode)) {
            switch (verifyCode) {
                case REGISTER:
                    template = REGISTER_TEMPLATE;
                    break;
                case VERIFIED:
                    template = VERIFIED_TEMPLATE;
                    break;
                case SET_PASSWORD:
                    template = SET_PASSWORD_TEMPLATE;
                    break;
                default:
                    break;
            }
        }
        return template;
    }

}
